<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/upload/tz_upload.js"></script>
<script type="text/javascript" src="js/sg/tz_util.js"></script>
<script type="text/javascript" src="js/sg/sg.js"></script>
<link rel="stylesheet" href="css/upload.css">
<link rel="stylesheet" href="js/upload/upload.css">
<title>Title</title>
<style>
</style>
</head>
<body>
	<div class="top">
		<div class="t_header">
			<div class="t_logo">
				<a href="#"> <img src="image/icon.png" alt="äºè§æ"
					height="35" width="136">
				</a>
			</div>
			<div class="t_desc">百度云盘</div>
		</div>
	</div>
	<div class="tools">
		<span class="t_upload" id="upload_btn">上传文件</span>
	</div>

	<div class="file">
		<table>
			<thead>
				<tr>
					<td>文件</td>
					<td>文件名称</td>
					<td>时间</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody id="f_tbody">
				
			</tbody>

		</table>
	</div>
	
	<script type="text/javascript">
	loading("我是刘老师，太帅了！",5);
		$.tmUpload({
			btnId:"upload_btn",
			url:"<%=path%>/data.jsp",
			limitSize:"1000 MB",
			fileType:"*.*",
			multiple : true,
			callback:function(serverData,file){
				var jsonData = eval("("+serverData+")");
				$("#f_tbody").append("<tr class='f_item'>"+
									"<td><img src='"+jsonData.url+"' alt='预览图像' width='40' height='40' /></td>"+
									"<td>"+jsonData.name+"</td>"+
									"<td>2016-02-21</td>"+
									"<td><a href='#' onclick='mydel(this)'>删除</a></td>"+
									"</tr>");
			}
		});
		// 删除
		function mydel(obj){
			$.tzAlert({content:"您确定要删除吗？",callback:function(ok){
				if(ok){
					$(obj).parents(".f_item").fadeOut(1000,function(){
						$(this).remove();
					});
				}
			}});
			
		}
	</script>
</body>
</html>